<template>
  <div :style="{ marginTop: mt, marginLeft: ml, marginBottom: mb }" class="outer">
    <div class="title-container">
      <div :class="`dec${size}`" :style="{ backgroundColor: cl }"></div>
      <div :class="`title${size}`">
        {{ title }}
      </div>
    </div>
    <slot></slot>
  </div>
</template>

<script setup>
  const props = defineProps({
    title: {
      type: String,
      default: '标题文字'
    },
    mt: {
      type: String,
      default: '15px'
    },
    ml: {
      type: String,
      default: '10px'
    },
    mb: {
      type: String,
      default: '10px'
    },
    cl: { // 主题颜色
      type: String,
      default: '#076aa7'
    },
    size: { // 尺寸选择：large | small | 不填
      type: String,
      default: ''
    }
  });
</script>

<style lang="scss" scoped>
  .outer{
    display: flex;
    align-items: center;
  }
  .title-container{
    height: 30px;
    width: fit-content;
    display: flex;
    align-items: center;
    .dec{
      width: 6px;
      height: 70%;
      border-radius: 10px;
      margin-right: 10px;
    }
    .title{
      font-size: 16px;
      color: #002943;
    }
    .declarge{
      width: 6px;
      height: 75%;
      border-radius: 11px;
      margin-right: 11px;
    }
    .titlelarge{
      font-size: 18px;
      color: #002943;
    }
    .decsmall{
      width: 5px;
      height: 60%;
      border-radius: 9px;
      margin-right: 9px;
    }
    .titlesmall{
      font-size: 14px;
      color: #002943;
    }
  }
</style>